package com.base.component.ai.workflow.flow;

import java.util.List;

import com.base.component.ai.workflow.node.Node;
import com.gitee.magic.core.valid.annotation.Length;
import com.gitee.magic.core.valid.annotation.NotNull;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Getter@Setter@ToString
public class Flow {
	
	@Schema(description="名称(全局唯一)")
	@NotNull
	@Length
	private String name;

	@Schema(description="节点")
	@NotNull
	private Node node;

	@Schema(description="下一步")
	@NotNull
	private List<Flow> nexts;
	
	public static Flow ofFlow(String name,Node node) {
		Flow flow=new Flow();
		flow.setName(name);
		flow.setNode(node);
		return flow;
	}
	
}
